import { axios } from '@/libs/api.request'

export const Login = formData => {
  return axios.post('api/RBAC/Login', formData)
}

export const GetUserInfo = () => {
  return axios.get('api/RBAC/GetUserInfo')
}

export const UpdatePwd = form => {
  return axios.post('api/RBAC/UpdatePwd', form)
}

export const GetUserRole = id => {
  return axios.get('api/RBAC/GetUserRole/' + id)
}
export const getCaptcha = () => {
  return axios.get('api/RBAC/getCaptcha')
}
// #region   角色
export const GetRoles = () => {
  return axios.get('api/RBAC/GetRoles')
}
export const GetRolesByUserType = type => {
  return axios.get('api/RBAC/GetRolesByUserType/' + type)
}
export const GetRoleMenuTreeList = () => {
  return axios.get('api/RBAC/GetRoleMenuTreeList')
}

export const DeleteRole = id => {
  return axios.post('api/RBAC/DeleteRole/' + id)
}
export const SaveRole = form => {
  return axios.post('api/RBAC/SaveRole', form)
}
export const GetRoleMenu = id => {
  return axios.get('api/RBAC/GetRoleMenu/' + id)
}

export const GrantRoleMenu = form => {
  return axios.post('api/RBAC/GrantRoleMenu', form)
}

// #endregion

 
// #endregion
// #region   员工
export const SearchUser = form => {
  return axios.post('api/RBAC/SearchUser', form)
}

export const SaveUser = form => {
  return axios.post('api/RBAC/SaveUser', form)
}

export const DeleteUser = id => {
  return axios.post('api/RBAC/DeleteUser/' + id)
}

export const ResetUserPwd = id => {
  return axios.post('api/RBAC/ResetUserPwd/' + id)
}

export const GetUserByNode = id => {
  return axios.get('api/RBAC/GetUserByNode/' + id)
}

export const GetUserMenu = id => {
  return axios.get('api/RBAC/GetUserMenu/' + id)
}

export const GrantUserMenu = form => {
  return axios.post('api/RBAC/GrantUserMenu', form)
}

// #endregion

 